package com.ruoyi.web.controller.wxpay;
import com.ruoyi.weixin.domain.KssUserPay;
import com.ruoyi.weixin.service.IKssUserPayService;
import com.ruoyi.weixin.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author 徐柯
 * @Title:
 * @Package
 * @Description:
 * @date 2021/5/1022:59
 */
@Controller
@RequestMapping("/api")
public class MonitorController {

    @Autowired
    private IKssUserPayService kssUserPayService;

    /**
     * 定义监听类
     * @param courseid
     * @return
     */
    @ResponseBody
    @GetMapping("/paySuccess")
    public R paySuccess(String courseid) {
        KssUserPay kssUserPay = new KssUserPay();
        kssUserPay.setUserid("1");
        kssUserPay.setCourseid(courseid);
        List<KssUserPay> list = kssUserPayService.selectKssUserPayList(kssUserPay);
        return list.size() > 0 ? R.ok() : R.error();
   }
}